import { BASE_URL } from '@/config/public'
import { METHOD, request } from '@/utils/request'

export default {
  //查询产品信息
  getProductInfo: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/product/query`,
      METHOD.GET,
      params
    )
  },
  // 产品动态列表
  getDynamicsList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/message/product/trend`,
      METHOD.POST_JSON_ENCRYPT,
      params
      // { isNeedToken: false }
    )
  },
  // 产品列表
  getprodList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/product/list`,
      // METHOD.GET,
      METHOD.GET_PARAM_ARRAY,
      params,
      { isNeedToken: false }
    )
  },
  // 查询出单方式筛选列表
  getprodListByInOnline: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/product/inOnline`,
      METHOD.GET,
      params,
      { isNeedToken: false }
    )
  },
  // 查询保险机构筛选列表
  getprodListBypartner: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/product/partner`,
      METHOD.GET,
      params,
      { isNeedToken: false }
    )
  },
  // 查询产品子类型筛选列表
  getprodListBysubType: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/product/subType`,
      METHOD.GET,
      params,
      { isNeedToken: false }
    )
  },
  // 查询适用人群筛选列表
  getprodListBysuitableGroup: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/product/suitableGroup`,
      METHOD.GET,
      params,
      { isNeedToken: false }
    )
  },
  // ================================线下录单============================
  // 线下录单查询所有客户,投被保人和受益人
  getCustomerList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/customer/list`,
      METHOD.GET,
      params
    )
  },
  // 线下录单保存投被保人信息，返回订单id
  saveCustomer: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/customer/save`,
      // METHOD.GET,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  // 身份证OCR识别
  judgeIDCard: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/idcard`,
      METHOD.POST_FORM,
      params
    )
  },
  // 银行卡OCR识别
  judgeBankCard: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/bankcard`,
      METHOD.POST_FORM,
      params
    )
  },
  // 线下录单第二步查询被保人信息
  getInsuredQuery: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/insured/query`,
      METHOD.GET_PARAM_ARRAY,
      params
    )
  },
  // 线下录单查询代理人信息
  getPartTimerList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/partTimer`,
      METHOD.GET,
      params
    )
  },
  // 线下录单第三步保单配送和附件关联信息保存
  saveReceiver: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/recevier/save`,
      // METHOD.GET,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  // 线下录单查询险种信息
  getRiskQuery: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/risk/query`,
      METHOD.GET,
      params
    )
  },
  // 线下录单保存录入险种信息
  saveRiskInfo: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/risk/save`,
      // METHOD.GET,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  // 获取产品详情信息:==========线下录单第三步保单配送和附件关联信息保存
  getProductDetailInfo: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/record/query`,
      METHOD.GET,
      params
    )
  }
}
